Alarm Type Expressions
The Expression tab is where the alarm evaluation logic is configured. Alarm evaluation logic uses GENESIS64™ expressions. The expression returns an integer number or value representing a single alarm condition. For example, the defined input variables (Data Source, Normal, HI, and LO conditions) combined with the condition alarm codes (0 Normal, 1 HI, 2 LO) use the expression to determine whether an alarm should be triggered based on the evaluated condition, identifying the current alarm state. The following is an example of a HI Limits alarm expression.
All expressions used within an alarm type can use historical and generic methods to call functions, making it possible to define alarms based on certain data points or history. These calls are not limited to GENESIS64 products but may call 3rd party servers via OPC UA and OPC HDA interfaces.
Defined alarm type inputs can be used as an expression input variable, meaning each alarm condition can override the primary evaluation expression. For example, If a HI alarm condition occurs, another expression generates the "Return to Normal" condition. To a certain extent, this simplifies expression coding. Refer to Creating Alarm Type Custom Functions for documenting complex expressions for reuse.
Additionally, all alarm expressions (condition evaluation, fields, or settings) can use historical and standard method call functions to define alarms based on data points, such as monitoring historical value trends or calling data from third-party servers via OPC UA or OPC HDA interface. The Data Point Functions menu lists these methods and is accessed through the Expressions Editor Functions button.
Additional expressions are available:
- Arithmetic includes addition, subtraction, multiplication, division, and many common mathematical constants and operands for use in arithmetic and logical functions.
- Relational expressions use standard relational operators (<, >, <=, >=, ==, !=) to make comparisons between multiple input states, resulting in a true or false outcome.
- Logical expressions are typically used where the intended result will be true or false. They include a variety of functions to structure logic for comparisons between multiple input states.
- Bitwiseincludes symbols and characters that operate at the binary level and involve the manipulation of individual bits.
- Code Blocks includes advanced capabilities for creating functional programming code snippets you define directly in an expression. They support sequential operations, looping, and defined return statements within the expression.
- Functions include string, arrays, data point, time span, date and time functions, and custom expression type functions.
- Variables contain a list of defined inputs that you can use in an expression. Variables require curly brackets within the syntax of the expression. For example: {{DataSource}} >= {{HiValue}}.
Refer to the Expression Editor for additional information.